import { ref } from 'vue'

const now = ref(new Date())

export const SettingBtnConfig = [
  {
    buttonIcon: 'icon-rili',
    tip: 'list.addbar.date.tip',
    datePicker: {
      hasTime: false,
      datePickerIcon: 'icon-rili11',
      datePickerTitle: 'list.addbar.date.options.selectdate'
    },
    commonOptions: [
      {
        icon: 'icon-rili-',
        preTitle: 'list.addbar.date.options.today',
        suffixTitle: `time.week.${now.value.getDay()}`
      },
      {
        icon: 'icon-rili2',
        preTitle: 'list.addbar.date.options.tomorrow',
        suffixTitle: `time.week.${(now.value.getDay() + 1) % 7}`
      },
      {
        icon: 'icon-rili1',
        preTitle: 'list.addbar.date.options.nextweek',
        suffixTitle: 'time.week.1'
      }
    ]
  },
  {
    buttonIcon: 'icon-naozhong',
    tip: 'list.addbar.remind.tip',
    datePicker: {
      hasTime: true,
      afterTime: now.value.getHours() > 20 ? undefined : now.value.getHours() + 3,
      datePickerIcon: 'icon-rili11',
      datePickerTitle: 'list.addbar.remind.options.selecttime'
    },
    commonOptions: [
      {
        icon: 'icon-rili-',
        preTitle: 'list.addbar.remind.options.after',
        suffixTitle: `time.week.${now.value.getDay()}`
      },
      {
        icon: 'icon-rili2',
        preTitle: 'list.addbar.remind.options.tomorrow',
        suffixTitle: `time.week.${(now.value.getDay() + 1) % 7}`
      },
      {
        icon: 'icon-rili1',
        preTitle: 'list.addbar.remind.options.nextweek',
        suffixTitle: 'time.week.1'
      }
    ]
  }
]

/**
 * 重复按钮配置
 */
export const repeatConfig = [
  {
    value: 24,
    title: 'list.addbar.repeat.options.everyday'
  },
  {
    value: 5,
    title: 'list.addbar.repeat.options.workingdays'
  },
  {
    value: 7,
    title: 'list.addbar.repeat.options.everyweek'
  },
  {
    value: 30,
    title: 'list.addbar.repeat.options.everymonth'
  },
  {
    value: 365,
    title: 'list.addbar.repeat.options.everyyear'
  },
  {
    value: 0,
    title: 'list.addbar.repeat.options.selectperiod'
  }
]
